<template>
    <div>
        <mycate :data="data"></mycate>
    </div>
</template>
<script>
import mycate from './mycate.vue'
export default {
    data(){
        return{
            data:{}
        }
    },
    components:{
        mycate
    },
    mounted:function(){
        this.get_data();
    },
    methods:{
        get_data:function(){
            this.axios.get('http://127.0.0.1:8000/get_cate').then(resp=>{
                console.log(resp.data)
                var mytree = {'id':0,name:''};
                mytree['children'] = resp.data
                this.data = mytree
            }).catch(error=>{
                console.log(error)
            })
        }
    }
}
</script>
<style>
ul{
    padding-left:100px;
    list-style:none
}
</style>